class TestBaseData < ActiveRecord::Base
  attr_accessible :base_data, :base_data_created_at, :base_data_type, :used_days_ago, :used_threshold, :user_uuid
  
  def self.new_with_json json
    TestBaseData.new({ :user_uuid => json[:userUUID],
                       :base_data_created_at => DateTime.parse(Time.at(json[:baseDataCreatedAt] / 1000).to_s),
                       :base_data_type => json[:baseDataType],
                       :used_threshold => json[:usedThreshold],
                       :used_days_ago => json[:usedDaysAgo], 
                       :base_data => Marshal.dump(json[:baseData]) 
    })
  end
end
